<?php
namespace App\Api\Requests\User;

use App\Api\Requests\BaseRequest;

class UpdateDetailRequest extends BaseRequest{
    /**
     * 确定当前经过身份验证的用户是否可以执行请求操作
     *
     * @return bool
     */
    public function authorize(){
        return true;
    }

    /**
     * 返回适用于请求数据的验证规则
     *
     * @return array
     */
    public function rules(){
        return [
            'nickname'=> array('required'),
            'sex'=> array('required'),
            'birthday'=> array('required'),
            'face_score'=> array('required'),
            'height'=> array('required'),
            'contact'=> array(new \App\Api\Rules\ContactVerify),
            'city'=> array('required'),
            'hometown'=> array('required'),
            'education'=> array('required'),
            'college'=> array('required'),
            'income'=> array('required'),
            'marriage'=> array('required'),

        ];
    }

    public function messages(){
        return [
            'nickname.required'=> '请输入昵称',
            'sex.required'=> '请选择性别',
            'birthday.required'=> '请选择出生年月',
            'face_score.required'=> '请选择颜值标签',
            'height.required'=> '请选择身高',
            'city.required'=> '请选择所在城市',
            'hometown.required'=> '请选择家乡',
            'education.required'=> '请选择学历',
            'college.required'=> '请选择毕业院校',
            'income.required'=> '请选择年收入',
            'marriage.required'=> '请选择婚姻状况',
        ];
    }
}